home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / EPPC.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  5KB  |  172 lines

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __EPPC__
  19. #define __EPPC__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __APPLETALK__
  25. #include <AppleTalk.h>
  26. #endif
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. #endif
  30. #ifndef __PPCTOOLBOX__
  31. #include <PPCToolbox.h>
  32. #endif
  33. #ifndef __PROCESSES__
  34. #include <Processes.h>
  35. #endif
  36. #ifndef __EVENTS__
  37. #include <Events.h>
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT_SUPPORTED
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_ALIGN_SUPPORTED
  49. #pragma options align=mac68k
  50. #endif
  51.  
  52.  
  53. enum {
  54.                                                                 /* postOptions currently supported */
  55.     receiverIDMask                = 0x0000F000,
  56.     receiverIDisPSN                = 0x00008000,
  57.     receiverIDisSignature        = 0x00007000,
  58.     receiverIDisSessionID        = 0x00006000,
  59.     receiverIDisTargetID        = 0x00005000,
  60.     systemOptionsMask            = 0x00000F00,
  61.     nReturnReceipt                = 0x00000200,
  62.     priorityMask                = 0x000000FF,
  63.     nAttnMsg                    = 0x00000001
  64. };
  65.  
  66.  
  67. enum {
  68.                                                                 /* constant for return receipts */
  69.     HighLevelEventMsgClass        = 'jaym',
  70.     rtrnReceiptMsgID            = 'rtrn'
  71. };
  72.  
  73.  
  74. enum {
  75.     msgWasPartiallyAccepted        = 2,
  76.     msgWasFullyAccepted            = 1,
  77.     msgWasNotAccepted            = 0
  78. };
  79.  
  80. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  81. struct TargetID {
  82.     long                             sessionID;
  83.     PPCPortRec                         name;
  84.     LocationNameRec                 location;
  85.     PPCPortRec                         recvrName;
  86. };
  87. typedef struct TargetID TargetID;
  88.  
  89. typedef TargetID *TargetIDPtr;
  90. typedef TargetIDPtr *TargetIDHandle;
  91. typedef TargetIDHandle TargetIDHdl;
  92. typedef TargetID SenderID;
  93. typedef SenderID *SenderIDPtr;
  94. #endif
  95. struct HighLevelEventMsg {
  96.     unsigned short                     HighLevelEventMsgHeaderLength;
  97.     unsigned short                     version;
  98.     unsigned long                     reserved1;
  99.     EventRecord                     theMsgEvent;
  100.     unsigned long                     userRefcon;
  101.     unsigned long                     postingOptions;
  102.     unsigned long                     msgLength;
  103. };
  104. typedef struct HighLevelEventMsg HighLevelEventMsg;
  105.  
  106. typedef HighLevelEventMsg *HighLevelEventMsgPtr;
  107. typedef HighLevelEventMsgPtr *HighLevelEventMsgHandle;
  108. typedef HighLevelEventMsgHandle HighLevelEventMsgHdl;
  109. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  110. typedef pascal Boolean (*GetSpecificFilterProcPtr)(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  111.  
  112. #if GENERATINGCFM
  113. typedef UniversalProcPtr GetSpecificFilterUPP;
  114. #else
  115. typedef GetSpecificFilterProcPtr GetSpecificFilterUPP;
  116. #endif
  117.  
  118. enum {
  119.     uppGetSpecificFilterProcInfo = kPascalStackBased
  120.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  121.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
  122.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(HighLevelEventMsgPtr)))
  123.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const TargetID *)))
  124. };
  125.  
  126. #if GENERATINGCFM
  127. #define NewGetSpecificFilterProc(userRoutine)        \
  128.         (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  129. #else
  130. #define NewGetSpecificFilterProc(userRoutine)        \
  131.         ((GetSpecificFilterUPP) (userRoutine))
  132. #endif
  133.  
  134. #if GENERATINGCFM
  135. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)        \
  136.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  137. #else
  138. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)        \
  139.         (*(userRoutine))((contextPtr), (msgBuff), (sender))
  140. #endif
  141. extern pascal OSErr PostHighLevelEvent(const EventRecord *theEvent, unsigned long receiverID, unsigned long msgRefcon, void *msgBuff, unsigned long msgLen, unsigned long postingOptions)
  142.  THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  143.  
  144. extern pascal OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, void *msgBuff, unsigned long *msgLen)
  145.  THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  146.  
  147. extern pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortRec *portName, ProcessSerialNumber *pPSN)
  148.  THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  149.  
  150. extern pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortRec *portName, const ProcessSerialNumber *pPSN)
  151.  THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  152.  
  153. extern pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *contextPtr, OSErr *err)
  154.  THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  155.  
  156. #endif
  157.  
  158. #if PRAGMA_ALIGN_SUPPORTED
  159. #pragma options align=reset
  160. #endif
  161.  
  162. #if PRAGMA_IMPORT_SUPPORTED
  163. #pragma import off
  164. #endif
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169.  
  170. #endif /* __EPPC__ */
  171.  
  172.